package org.ljy.rabbitmqspringboot.listener;

import org.ljy.rabbitmqspringboot.contant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicListener {
    @RabbitListener(queues = Constants.TOPIC_QUEUE1)
    public void topicListener1(String topic) {
        System.out.println("TopicListener1: " + topic);
    }

    @RabbitListener(queues = Constants.TOPIC_QUEUE2)
    public void topicListener2(String topic) {
        System.out.println("TopicListener2: " + topic);
    }
}
